{%- assign blocks = content | split: "<pre" -%}
{%- for block in blocks -%}
    {%- assign child_blocks = block | split: "</pre>" %}
    {%- if child_blocks.size == 1 -%}
        {{ block }}
    {%- else -%}
        {%- comment %} admonitions card {% endcomment -%}
        {%- assign admonitions = "note, tip, warning, danger" | split: ", " -%}
        {%- comment %} get pre code and type {% endcomment -%}
        {%- assign pre_blocks = child_blocks.first | replace_first: ">", "```<temp>```" | split: "```<temp>```" -%}
        {%- assign pre_type = pre_blocks.first | replace: '"', '' | replace: " class=notranslate language-", ""  -%}

        {%- if admonitions contains pre_type -%}
            <div class="admonition {{ pre_type }}">
                {%- comment %} title will be translated via ui {% endcomment -%}
                <p class="admonition-title" ui="{{ pre_type }}"><span class="progress"></span></p>{{ pre_blocks.last | markdownify | strip_newlines -}}
            </div>{{ child_blocks.last -}}
        {%- elsif pre_type == "mermaid" -%}
            <div class="mermaid">{{ pre_blocks.last }}</div>{{ child_blocks.last }}
        {%- else -%}
            <pre{{ child_blocks.first }}</pre> {{ child_blocks.last -}}
        {%- endif -%}
    {%- endif -%}
{%- endfor -%}
